﻿using DocumentFormat.OpenXml.Lite.DrawingML.Effect;
using DocumentFormat.OpenXml.Lite.DrawingML.Geometry;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Style
{
    [XmlRoot("fmtcheme", Namespace = Constants.Main)]
    public class FormatScheme : XmlSerializable
    {
        [Optional]
        [XmlAttribute("name", Form = XmlSchemaForm.Qualified)]
        public string Name { get; set; }

        /// <summary>
        /// Minimum 3 elemets required
        /// </summary>
        [XmlArray("fillStyleLst", Namespace = Constants.Main)]
        [XmlArrayItem("", Namespace = Constants.Main)]
        public XmlList<IFillProperty> FillStyles { get; set; }

        /// <summary>
        /// Minimum 3 elemets required
        /// </summary>
        [XmlArray("lnStyleLst", Namespace = Constants.Main)]
        [XmlArrayItem("ln", Namespace = Constants.Main)]
        public XmlList<Line> LineStyles { get; set; }

        /// <summary>
        /// Minimum 3 elemets required
        /// </summary>
        [XmlArray("effectStyleLst", Namespace = Constants.Main)]
        [XmlArrayItem("effectStyle", Namespace = Constants.Main)]
        public XmlList<EffectStyle> EffectStyles { get; set; }

        /// <summary>
        /// Minimum 3 elemets required
        /// </summary>
        [XmlArray("bgFillStyleLst", Namespace = Constants.Main)]
        [XmlArrayItem("", Namespace = Constants.Main)]
        public XmlList<IFillProperty> BackgroundFillStyles { get; set; }

        public FormatScheme() 
        {
            FillStyles = new XmlList<IFillProperty>();
            LineStyles = new XmlList<Line>();
            EffectStyles = new XmlList<EffectStyle>();
            BackgroundFillStyles = new XmlList<IFillProperty>();
        }
    }
}
